import unittest
from alg import threeSum

class TestThreeSum(unittest.TestCase):
    def test_example1(self):
        self.assertEqual(sorted(threeSum([-1,0,1,2,-1,-4])), sorted([[-1,-1,2],[-1,0,1]]))

    def test_example2(self):
        self.assertEqual(threeSum([0,1,1]), [])

    def test_example3(self):
        self.assertEqual(threeSum([0,0,0]), [[0,0,0]])

    def test_empty(self):
        self.assertEqual(threeSum([]), [])

    def test_all_positive(self):
        self.assertEqual(threeSum([1,2,3]), [])

    def test_all_negative(self):
        self.assertEqual(threeSum([-1,-2,-3]), [])

    def test_duplicates(self):
        self.assertEqual(threeSum([-2,0,0,2,2]), [[-2,0,2]])

if __name__ == '__main__':
    unittest.main()    